//
//  SearchSpecialTableCell.m
//  Coco_Music
//
//  Created by 强哥 on 15/6/24.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "SearchSpecialTableCell.h"
#import <UIImageView+WebCache.h>

@implementation SearchSpecialTableCell

-(void)dealloc
{
    [self.TitleLabel release];
    [self.SingerAndTime release];
    [self.SingerImage release];
    [self.searchSpecialInfo release];
    [self.ImageLine release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creation];
    }
    return self;
}
//专辑自定义cell
-(void)creation
{
    self.SingerImage = [[UIImageView alloc]initWithFrame:CGRectMake(self.frame.origin.x+10, self.frame.origin.y+10, 100, 100)];
    self.SingerImage.layer.masksToBounds = YES;
    self.SingerImage.layer.cornerRadius = 10;
    self.TitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.SingerImage.frame.origin.x+120, self.frame.origin.y+20, self.frame.size.width-100, 30)];
    self.TitleLabel.font = [UIFont fontWithName:@"Menlo-Bold" size:18];
    self.SingerAndTime = [[UILabel alloc]initWithFrame:CGRectMake(_TitleLabel.frame.origin.x, _TitleLabel.frame.origin.y+35, self.frame.size.width-100, 30)];
    self.SingerAndTime.textColor = [UIColor lightGrayColor];
    self.SingerAndTime.font = [UIFont systemFontOfSize:14];
    self.ImageLine = [[UIImageView alloc]initWithFrame:CGRectMake(_SingerImage.frame.size.width+20, _SingerImage.frame.size.height+2+10, [UIScreen mainScreen].bounds.size.width-_SingerImage.frame.size.width-40, 1)];
    _ImageLine.backgroundColor = [UIColor lightGrayColor];
    [self.contentView addSubview:_ImageLine];
    [self.contentView addSubview:_SingerAndTime];
    [self.contentView addSubview:_TitleLabel];
    [self.contentView addSubview:_SingerImage];
    [_SingerImage release];
    [_TitleLabel release];
    [_SingerAndTime release];
    [_ImageLine release];
}

-(void)setSearchSpecialInfo:(SearchSpecial *)searchSpecialInfo
{
    if (_searchSpecialInfo != searchSpecialInfo) {
        [_searchSpecialInfo release];
        _searchSpecialInfo = [searchSpecialInfo retain];
    }
    self.TitleLabel.text = searchSpecialInfo.name;
    NSLog(@"!!!!!!!!%@",self.TitleLabel.text);
    NSString *string2 = [NSString stringWithFormat:@"%@ %@",searchSpecialInfo.singer_name,searchSpecialInfo.publish_time];
    self.SingerAndTime.text = string2;
    NSString *string = searchSpecialInfo.pic200;
    NSURL *url = [NSURL URLWithString:string];
    [self.SingerImage sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"cm2_default_artist_banner-1"]];
    
    
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
